// 所有状态需要和后端保持一致，不可随意更改
const constant = {
  state: {
    // MerchantCustomerConstant,跟进状态，不可随意更改
    followStatusArray: [
      { status: 1, value: '已录入' },
      { status: 2, value: '跟进中' },
      { status: 5, value: '已预约' },
      { status: 6, value: '已试听' },
      { status: 9, value: '已签约' },
      { status: 10, value: '已关闭' }
    ],
    // 年级枚举值，不可随意更改
    gradeArray: [
      {
        options: [
          { value: 0, label: '不详'}
        ]
      },
      {
        label: '学前教育',
        options: [
          { value: 1, label: '学前班' },
          { value: 2, label: '幼儿园' }
        ]
      },
      {
        label: '小学',
        options: [
          { label: '一年级', value: 11 },
          { label: '二年级', value: 12 },
          { label: '三年级', value: 13 },
          { label: '四年级', value: 14 },
          { label: '五年级', value: 15 },
          { label: '六年级', value: 16 }
        ]
      },
      {
        label: '初中',
        options: [
          { label: '初一', value: 21 },
          { label: '初二', value: 22 },
          { label: '初三', value: 23 }
        ]
      },
      {
        label: '高中',
        options: [
          { label: '高一', value: 31 },
          { label: '高二', value: 32 },
          { label: '高三', value: 33 }
        ]
      }
    ],
    // 性别枚举值，不可随意更改
    genderArray: [
      { value: 0, label: '保密' },
      { value: 1, label: '男' },
      { value: 2, label: '女' }
    ],
    // 收费方式枚举值，不可随意更改
    chargeTypes: [
      { label: '现金', value: 1 },
      { label: '支付宝', value: 2 },
      { label: '微信', value: 3 },
      { label: '转账', value: 4 },
      { label: '公对公转账', value: 5}
    ],
    // 班级类型
    classTypes: [
      { value: 1, label: '一对一' },
      { value: 2, label: '小组课' }
    ],
    sourceArray: [
      { value: 10, label: '直访客户'},
      { value: 20, label: '公开课'},
      { value: 21, label: '地面广告'},
      { value: 22, label: "互联网广告"},
      { value: 23, label: '朋友圈转发'},
      { value: 30, label: '转介绍'}
    ],
    intentions: [
      { value: 1, label: '无意向' },
      { value: 2, label: '较低意向' },
      { value: 3, label: '一般意向' },
      { value: 4, label: '较强意向'}
    ],
    promotionMethods: [
      { value: 0, label: '无优惠' },
      { value: 1, label: '折扣' }
    ],
    auditStatusList: [
      { value: 1, label: '未审核' },
      { value: 10, label: '已通过' },
      { value: 11, label: '已拒绝'}
    ],
    orderStatusList: [
      { value: 1, label: '待支付' },
      { value: 2, label: '已支付待审核' },
      { value: 9, label: '支付已确认'},
      { value: 10, label: '退款待审核'},
      { value: 11, label: '审核失败' },
      { value: 19, label: '已完成'}
    ],
    orderContractTypes: [
      { value: 1, label: '订课' },
      { value: 2, label: '续费' },
      { value: 3, label: '转介绍' },
      { value: 4, label: '退费' },
      { value: 5, label: '试听' },
      { value: 6, label: '拼团' }
    ],
  },
  getters: {
    getGradeName: (state) => (grade) => {
      let gradeName = ''
      try {
        state.gradeArray.forEach(gradeGroup => {
          gradeGroup.options.forEach(g => {
            if (g.value === grade) {
              gradeName = g.label
              // eslint-disable-next-line no-throw-literal
              throw '找到班级:' + gradeName
            }
          })
        })
        // eslint-disable-next-line no-empty
      } catch (e) {}
      return gradeName
    }
  }
}

export default constant
